package com.zzq.my.jetpacks.jectpackapp.ui.act

import android.view.ViewGroup
import android.widget.LinearLayout
import by.kirich1409.viewbindingdelegate.viewBinding
import com.aisier.architecture.base.BaseActivity
import com.zzq.my.jetpacks.jectpackapp.R
import com.zzq.my.jetpacks.jectpackapp.adapter.RvGrowUpAdapter
import com.zzq.my.jetpacks.jectpackapp.databinding.ActivityGrowupcenterBinding
import com.zzq.my.jetpacks.util.goActivity

/**
 * 描述：ViewPager + FragmentPagerAdapter
 * 作者：zhuangzeqin
 * 时间: 2022/1/18-17:04
 * 邮箱：zzq@eeepay.cn
 * 备注:
 */
class GrowUpCenterAct : BaseActivity(R.layout.activity_growupcenter) {
    private val vb by viewBinding(ActivityGrowupcenterBinding::bind)

    private val dataList: MutableList<String> = mutableListOf()
    private lateinit var mRvGrowUpAdapter: RvGrowUpAdapter

    /**
     * 初始化数据
     */
    override fun initData() {
//        if (::mRvGrowUpAdapter.isInitialized)
        mRvGrowUpAdapter = RvGrowUpAdapter()
        val moredata = layoutInflater.inflate(R.layout.item_moredata, null)
        val layoutParams = ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT
        )
        moredata.layoutParams = layoutParams

        dataList.apply {
            add("展示文案最多两行超过1...")
            add("展示文案最多两行超过2...")
            add("展示文案最多两行超过3...")
            add("展示文案最多两行超过4...")
            add("展示文案最多两行超过5...")
        }
        mRvGrowUpAdapter.setList(dataList)
        vb.rvGrowupcenter.adapter = mRvGrowUpAdapter
        mRvGrowUpAdapter.addFooterView(moredata, -1, LinearLayout.HORIZONTAL)
        mRvGrowUpAdapter.footerLayout?.setOnClickListener {
//            showMsg("aaaa")
            goActivity<CoordinatorLayoutAct>()
        }


    }

    /**
     * 初始化操作
     */
    override fun initView() {

    }

    /**
     * 初始化点击事件操作
     */
    override fun eventOnClick() {
        vb.btnTestRadius.setOnClickListener {
            goActivity<RecyleViewMenuAct>()
        }
    }
}